package com.sfgeeq.chapter312.web;


import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by vmuser010 on 2016/11/4.
 */
@Controller
public class HelloController {
    @RequestMapping("/")
    public String index(ModelMap map) {
        // 加入一个属性，用来在模板中读取
        map.addAttribute("host", "http://blog.didispace.com");
        map.addAttribute("title", "测试的标题");
        map.addAttribute("imgUrl", "../static/2.jpg");

        // return模板文件的名称，对应src/main/resources/templates/index.html
        return "123";
    }
}